package com.translate;

import com.processor.base.DisruptorProcessor;
import com.lmax.disruptor.EventTranslator;
import com.event.ProcessorEvent;
import com.handler.BaseHandler;

/**
 * @author : gameZhao
 * @version V1.0
 * @Project: disruptorDemo
 * @Package PACKAGE_NAME
 * @Description: disruptor参数设置器
 * @date Date : 2021年12月27日 14:49
 */
public class ProcessorEventTranslator implements EventTranslator<ProcessorEvent> {
    
    private BaseHandler handler;
    private DisruptorProcessor baseProcessors;
    public ProcessorEventTranslator(BaseHandler handler, DisruptorProcessor baseProcessors){
        this.handler = handler;
        this.baseProcessors = baseProcessors;
    }
    
    @Override
    public void translateTo(ProcessorEvent processorEvent, long sequence) {
        processorEvent.setHandler(handler);
    }
}
